<?php

class GalleryPhoto {

    // @var string The id of the photo
    private $key;
    // @var string The title of the photo
    private $title;
    // @var string The source location of the image
    private $src;
    // @var string The image caption
    private $caption;

    public function __construct($key, $photo) {
        $this->key = $key;
        $this->title = $photo->title;
        $this->src = pathinfo($photo->src);
        $this->caption = $photo->caption;
    }

    public function getTitle() { return $this->title; }
    public function getCaption() { return $this->caption; }
    public function getImage() {
        return $this->src['dirname'] . DIRECTORY_SEPARATOR . $this->src['basename'];
    }
    public function getThumb() {
        return $this->src['dirname'] . DIRECTORY_SEPARATOR . $this->src['filename'] . '-thumb.' . $this->src['extension'];
    }
    public function getCover() {
        return $this->src['dirname'] . DIRECTORY_SEPARATOR . $this->src['filename'] . '-cover.' . $this->src['extension'];
    }
    public function getId() { return $this->key; }
}
